package future;

/**
 * @Classname RunnableCantThrowsException
 * @Description 在run方法中无法抛出checked Exception
 * @Date 2025/1/13 16:12
 * @Author zhuzhenguo
 */
public class RunnableCantThrowsException {

    public void ddd() throws Exception {
    }

    public static void main(String[] args) {
        // runnable没有声明异常，咱也没法声明
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                try {
                    throw new Exception();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        };
    }

}
